<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>CClub视频面试</title>
    <script src="https://cdn.bootcss.com/vue/2.6.8/vue.min.js"></script>
    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
    <link rel="stylesheet" href="css/index.css">
    <script src="https://unpkg.com/element-ui/lib/index.js"></script>
    <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
</head>
<body>
<div id="app">
    <div style="margin-left:30px;margin-top:15px;font-size:24px;">
        <div style="float:left;">{{name}}</div>
        <div style="float:left;margin-left:1080px;">
            <a href="javascript:void(0);" @click="exam" style="text-decoration:none;color:rgb(30,30,30);font-size:16px;">在线笔试</a>
        </div>
        <div style="float:left;margin-left:30px;">
            <el-dropdown placement="bottom-start">
                <span class="el-dropdown-link">{{userInfo.user_company}}
                    <i class="el-icon-arrow-down el-icon--right"></i>
                </span>
                <el-dropdown-menu slot="dropdown">
                    <el-dropdown-item style="background-color:#f6f8ff;">{{userInfo.user_phone}}</el-dropdown-item>
                    <el-dropdown-item disabled style="font-size:12px;">当前公司:</el-dropdown-item>
                    <el-dropdown-item style="font-size:12px;">&nbsp;&nbsp;&nbsp;{{userInfo.user_company}}</el-dropdown-item>
                    <el-dropdown-item >个人中心</el-dropdown-item>
                    <el-dropdown-item divided>
                        <a href="javascript:void(0);" @click="signOut" style="text-decoration:none;color:rgb(30,30,30);">
                            退出登录
                        </a>
                    </el-dropdown-item>
                </el-dropdown-menu>
            </el-dropdown>
        </div>
    </div>
    <div style="padding-top:50px;">
        <div>
            <template>
                <el-tabs v-model="activeName" @tab-click="handleClick">
                    <el-tab-pane label="我创建的面试" name="first">
                        <div>
                            <span style="float:left;">我创建的面试({{tableData.length}})</span>
                            <el-button type="primary" style="float:left;margin-left:1230px;" size="small" @click="dialogVisible_my_create=true">新建视频面试</el-button>
                        </div>
                        <div style="padding-top:40px;">
                            <template>
                                <el-table :data="tableData" stripe style="width: 100%" :ref="tableData">
                                    <el-table-column prop="info" label="基本信息" width="220">
                                        <template slot-scope="scope">
                                            <p>
                                                <span style="float:left;">公司:</span>
                                                <span style="float:left;margin-left:5px;">{{scope.row.interview_company_name}}</span>
                                            </p>
                                            <p style="padding-top:25px;">
                                                <span style="float:left;">职位:</span>
                                                <span style="float:left;margin-left:5px;">{{scope.row.interview_candidate_position}}</span>
                                            </p>
                                            <p style="padding-top:10px;">
                                                <span style="float:left;">候选人:</span>
                                                <span style="float:left;margin-left:5px;">{{scope.row.interview_candidate_name}}</span>
                                            </p>
                                        </template>
                                    </el-table-column>
                                    <el-table-column prop="interview_begin_time" label="视频面试开始时间" width="180" sortable>
                                    </el-table-column>
                                    <el-table-column prop="" label="面试官接入" width="220">
                                        <template slot-scope="scope">
                                            <p>接入码:&nbsp;&nbsp;{{scope.row.interview_judge_code}}</p>
                                            <p><a href="javascript:void(0);" class="el-font-color" @click="centerInterview(scope.row.interview_judge_code,scope.row.interview_room_state)">进入面试</a></p>
                                            <p style="margin-top:-10px;">
                                                <span style="float:left;">
                                                    <a href="javascript:void(0);" class="el-font-color_link">复制链接</a>
                                                </span>
                                                <span style="float:left;margin-left:10px;">
                                                    <a href="javascript:void(0);" class="el-font-color_link" @click="copyLinkContent(scope.row.interview_invitation_judge_notice)">复制通知</a>
                                                </span>
                                            </p>
                                            <p style="margin-top:40px;">
                                                <span style="float:left;">{{scope.row.interview_judge_name}}</span>
                                                <span style="float:left;margin-left:10px;">{{scope.row.interview_judge_phone}}</span>
                                            </p>
                                        </template>
                                    </el-table-column>
                                    <el-table-column prop="" label="候选人接入" width="220">
                                        <template slot-scope="scope">
                                            <p>接入码:&nbsp;&nbsp;{{scope.row.interview_candidate_code}}</p>
                                            <p><a href="javascript:void(0);" class="el-font-color" @click="centerInterview(scope.row.interview_candidate_code,scope.row.interview_room_state)">进入面试</a></p>
                                            <p style="margin-top:-10px;">
                                                <span style="float:left;">
                                                    <a href="javascript:void(0);" class="el-font-color_link" @click="">复制链接</a>
                                                </span>
                                                <span style="float:left;margin-left:10px;">
                                                    <a href="javascript:void(0);" class="el-font-color_link" @click="copyLinkContent(scope.row.interview_invitation_candidate_notice)">复制通知</a>
                                                </span>
                                            </p>
                                            <p style="margin-top:40px;">
                                                <span style="float:left;">{{scope.row.interview_candidate_name}}</span>
                                                <span style="float:left;margin-left:10px;">{{scope.row.interview_candidate_phone}}</span>
                                            </p>
                                        </template>
                                    </el-table-column>
                                    <el-table-column prop="" label="回放" width="160">
                                        <template slot-scope="scope">
                                            <div v-if="scope.row.interview_room_state==='33'">
                                                <p><a href="javascript:void(0);" class="el-font-color_link">查看回放</a></p>
                                                <p style="font-size:13px;color:rgb(139, 143, 148);">时长:1分28秒</p>
                                            </div>
                                            <div v-if="scope.row.interview_room_state!='33'">
                                                <p style="font-size:13px;color:rgb(139, 143, 148);">------------</p>
                                            </div>
                                        </template>
                                    </el-table-column>
                                    <el-table-column prop="" label="状态" width="140">
                                        <template slot-scope="scope">
                                            <div v-if="scope.row.interview_room_state==='01'">
                                                <p class="el-font-color-no">面试官未进入</p>
                                                <p>候选人已进入</p>
                                            </div>
                                            <div v-if="scope.row.interview_room_state==='00'">
                                                <p class="el-font-color-no">面试官未进入</p>
                                                <p class="el-font-color-no">候选未已进入</p>
                                            </div>
                                            <div v-if="scope.row.interview_room_state==='10'">
                                                <p>面试官已进入</p>
                                                <p class="el-font-color-no">候选未已进入</p>
                                            </div>
                                            <div v-if="scope.row.interview_room_state==='11'">
                                                <p>面试官已进入</p>
                                                <p>候选未已进入</p>
                                            </div>
                                            <div v-if="scope.row.interview_room_state==='22'">
                                                <p>面试已取消</p>
                                            </div>
                                            <div v-if="scope.row.interview_room_state==='33'">
                                                <p>面试已结束</p>
                                            </div>
                                        </template>
                                    </el-table-column>
                                    <el-table-column prop="" label="操作" width="180">
                                        <template slot-scope="scope">
                                            <p>
                                            <span style="float:left;" v-show="scope.row.interview_room_state==='01' || scope.row.interview_room_state==='10' || scope.row.interview_room_state==='00'">
                                                <a href="javascript:void(0);" class="el-font-color_link" @click="cancel_interview_open(scope.row.interview_id)">取消</a>
                                            </span>
                                                <span style="float:left;margin-left:15px;" v-show="scope.row.interview_room_state==='01' || scope.row.interview_room_state=='10' || scope.row.interview_room_state==='00'">
                                                <a href="javascript:void(0);" class="el-font-color_link" @click="modify_interview_open(scope.row)">编辑面试</a>
                                            </span>
                                            <span style="float:left;margin-left:15px;">
                                                <a href="javascript:void(0);" class="el-font-color_link" @click="delete_interview_open(scope.row.interview_id)">删除</a>
                                            </span>
                                            </p>
                                            <p style="padding-top:30px;" v-show="scope.row.interview_room_state==='01' || scope.row.interview_room_state=='10' || scope.row.interview_room_state==='00'">
                                                <a href="javascript:void(0);" class="el-font-color_link" @click="end_interview_open(scope.row.interview_id)">结束面试</a>
                                            </p>
                                        </template>
                                    </el-table-column>
                                    <el-table-column prop="" label="备注" width="180">
                                        <template slot-scope="scope">
                                            <p>
                                                <a href="javascript:void(0);" @click="getOneInterviewRemarks(scope.row.interview_id)">
                                                    <i class="el-icon-edit-outline" style="font-size:20px;color:#5272ff;"></i>
                                                </a>
                                            </p>
                                        </template>
                                    </el-table-column>
                                </el-table>
                            </template>
                        </div>
                    </el-tab-pane>
                    <!--创建视频面试-->
                    <el-dialog title="创建视频面试" :visible.sync="dialogVisible_my_create" width="40%" before-close="handleClose" >
                        <el-form ref="form" :model="form"  label-width="100px">
                            <el-form-item label="面试时间">
                                <el-col :span="11">
                                    <el-date-picker type="date" placeholder="选择日期" v-model="form.date.date1" style="width: 100%;"></el-date-picker>
                                </el-col>
                                <el-col class="line" :span="2">-</el-col>
                                <el-col :span="11">
                                    <el-time-picker placeholder="选择时间" v-model="form.date.date2" style="width: 100%;"></el-time-picker>
                                </el-col>
                            </el-form-item>
                            <el-form-item label="公司名称">
                                <el-input v-model="form.company" placeholder="公司/团队名称"></el-input>
                            </el-form-item>
                            <el-form-item label="应聘职位名称">
                                <el-input v-model="form.position" placeholder="职位名称，如开发工程师"></el-input>
                            </el-form-item>
                            <el-form-item label="通知候选人">
                                <el-input v-model="form.candidate.name" placeholder="姓名" style="width:150px;" size="small"></el-input>
                                <el-input v-model="form.candidate.phone" placeholder="手机号" style="width:150px;" size="small"></el-input>
                                <el-input v-model="form.candidate.mail" placeholder="邮箱" style="width:150px;" size="small"></el-input>
                            </el-form-item>
                            <el-form-item label="通知面试官">
                                <el-input v-model="form.judge.name" placeholder="姓名" style="width:150px;" size="small"></el-input>
                                <el-input v-model="form.judge.phone" placeholder="手机号" style="width:150px;" size="small"></el-input>
                                <el-input v-model="form.judge.mail" placeholder="邮箱" style="width:150px;" size="small"></el-input>
                            </el-form-item>
                            <el-form-item label="面试过程录制">
                                <el-switch v-model="form.recording"></el-switch>
                            </el-form-item>
                            <el-form-item label="候选人简历">
                                <el-checkbox v-model="form.checked" @change="change">上传候选人简历</el-checkbox>
                                <p :style="{display:form.resume}">
                                    <input type="file" name="" id="file" value="点击上传" @change="uploadBefore">
                                    <span style="font-size:12px;color:rgb(200,200,200);">支持扩展名: .pdf .docx</span>
                                </p>
                            </el-form-item>
                        </el-form>
                        <span slot="footer" class="dialog-footer">
                            <el-button @click="dialogVisible_my_create = false">取 消</el-button>
                            <el-button type="primary" @click="create_Interview">确 定</el-button>
                        </span>
                    </el-dialog>
                    <!--取消该面试-->
                    <el-dialog title="是否取消面试" :visible.sync="dialogVisible_cancel_interview" width="30%" before-close="handleClose" >
                        <el-form ref="form" :model="form"  label-width="100px">
                            <el-form-item label="通知候选人">
                                <el-checkbox v-model="cancelObj.isSendMail" @change="change">发送短信和邮件通知</el-checkbox>
                            </el-form-item>
                        </el-form>
                        <span slot="footer" class="dialog-footer">
                            <el-button @click="dialogVisible_cancel_interview = false">取 消</el-button>
                            <el-button type="primary" @click="cancel_interview">确 定</el-button>
                        </span>
                    </el-dialog>
                    <!--备注面试-->
                    <el-dialog title="面试反馈" :visible.sync="dialogVisible_remarks_interview" width="30%" before-close="handleClose">
                        <el-form ref="form" :model="form"  label-width="0px">
                            <el-form-item style="margin-top:-20px;">
                                <p>结果</p>
                                <p style="font-size:13px;color:#8b8f94;margin-top:-30px;">请给出候选人的面试结果</p>
                            </el-form-item>
                            <el-form-item style="margin-top:-45px;">
                                <template>
                                    <el-radio v-model="remarks.radio" label="1">通过</el-radio>
                                    <el-radio v-model="remarks.radio" label="2">拒绝</el-radio>
                                    <el-radio v-model="remarks.radio" label="3">待定</el-radio>
                                </template>
                            </el-form-item>
                            <el-form-item style="margin-top:-25px;">
                                <p>综合评价</p>
                                <p style="font-size:13px;color:#8b8f94;margin-top:-30px;">请详细说明候选人的优势、不足及任何值得注意的方面</p>
                            </el-form-item>
                            <el-form-item style="margin-top:-30px;">
                                <el-input type="textarea" :rows="4" placeholder="请输入内容" v-model="remarks.textarea">
                                </el-input>
                            </el-form-item>
                        </el-form>
                        <span slot="footer" class="dialog-footer">
                            <el-button @click="dialogVisible_remarks_interview = false">取 消</el-button>
                            <el-button type="primary" @click="setInterviewRemarks">确 定</el-button>
                        </span>
                    </el-dialog>
                    <!--修改视频面试-->
                    <el-dialog title="修改视频面试" :visible.sync="dialogVisible_interview_modify" width="40%" before-close="handleClose" >
                        <el-form ref="formModify" :model="formModify"  label-width="100px">
                            <el-form-item label="面试时间">
                                <el-col :span="11">
                                    <el-date-picker type="date" placeholder="选择日期" v-model="formModify.date.date1" style="width: 100%;"></el-date-picker>
                                </el-col>
                                <el-col class="line" :span="2">-</el-col>
                                <el-col :span="11">
                                    <el-time-picker placeholder="选择时间" v-model="formModify.date.date2" style="width: 100%;"></el-time-picker>
                                </el-col>
                            </el-form-item>
                            <el-form-item label="公司名称">
                                <el-input v-model="formModify.company" placeholder="公司/团队名称"></el-input>
                            </el-form-item>
                            <el-form-item label="应聘职位名称">
                                <el-input v-model="formModify.position" placeholder="职位名称，如开发工程师"></el-input>
                            </el-form-item>
                            <el-form-item label="通知候选人">
                                <el-input v-model="formModify.candidate.name" placeholder="姓名" style="width:150px;" size="small" :disabled="true"></el-input>
                                <el-input v-model="formModify.candidate.phone" placeholder="手机号" style="width:150px;" size="small" :disabled="true"></el-input>
                                <el-input v-model="formModify.candidate.mail" placeholder="邮箱" style="width:150px;" size="small" :disabled="true"></el-input>
                            </el-form-item>
                            <el-form-item label="通知面试官">
                                <el-input v-model="formModify.judge.name" placeholder="姓名" style="width:150px;" size="small" :disabled="true"></el-input>
                                <el-input v-model="formModify.judge.phone" placeholder="手机号" style="width:150px;" size="small" :disabled="true"></el-input>
                                <el-input v-model="formModify.judge.mail" placeholder="邮箱" style="width:150px;" size="small" :disabled="true"></el-input>
                            </el-form-item>
                            <el-form-item label="面试过程录制">
                                <el-switch v-model="formModify.recording"></el-switch>
                            </el-form-item>
                            <el-form-item label="候选人简历">
                                <el-checkbox v-model="formModify.checked" @change="changeModify">上传候选人简历</el-checkbox>
                                <p :style="{display:formModify.resume}">
                                    <input type="file" name="" id="fileModify" value="点击上传" @change="uploadBefore">
                                    <span style="font-size:12px;color:rgb(200,200,200);">支持扩展名: .pdf .docx</span>
                                </p>
                            </el-form-item>
                        </el-form>
                        <span slot="footer" class="dialog-footer">
                            <el-button @click="dialogVisible_interview_modify = false">取 消</el-button>
                            <el-button type="primary" @click="modify_interview">修改</el-button>
                        </span>
                    </el-dialog>
                    <el-tab-pane label="我参与的面试" name="second">我参与的面试</el-tab-pane>
                    <el-tab-pane label="公司全部面试" name="third">公司全部面试</el-tab-pane>
                    <el-tab-pane label="空中宣讲" name="fourth">空中宣讲</el-tab-pane>
                </el-tabs>
            </template>
        </div>
    </div>
    <div style="margin-left:1100px;margin-top:20px;">
        <el-pagination background layout="prev, pager, next" :total="pageSize"></el-pagination>
    </div>
</div>
<script>
    new Vue({
        el: '#app',
        data: {
            name: 'CCLUB 视频面试',
            userInfo:{
                user_phone: '',
                user_company: ''
            },
            form:{
                date:{
                    date1: '',
                    date2: ''
                },
                company: '',
                position: '',
                candidate:{
                    name: '',
                    phone: '',
                    mail: ''
                },
                judge:{
                    name: '',
                    phone: '',
                    mail: ''
                },
                recording:false,
                resume: 'none'
            },
            remarks:{
                radio: '',
                textarea: '',
                interview_id: ''
            },
            activeName: 'first',
            tableData: [],
            dialogVisible_my_create:false,
            dialogVisible_cancel_interview:false,
            dialogVisible_remarks_interview:false,
            dialogVisible_interview_modify:false,
            remarksList:[],
            pageSize: 0,
            allInterviewData: [],
            cancelObj:{
                interview_id: '',
                company: '',
                position: '',
                isSendMail: false,
                mail: '',
                name: ''
            },
            formModify:{
                date:{
                    date1: '',
                    date2: ''
                },
                company: '',
                position: '',
                candidate:{
                    name: '',
                    phone: '',
                    mail: ''
                },
                judge:{
                    name: '',
                    phone: '',
                    mail: ''
                },
                recording:false,
                resume: 'none',
                interview_id: ''
            },
            recordingList:[],
            websocket: null
        },
        created(){
            this.nowTime=new Date();
            this.getUserInfo();
            this.getMyCreateInterviewList();
            this.getMyCreateInterviewRemarksList();
            this.getMyCreateInterviewRecording();
        },
        methods:{
            handleClick(tab, event) {
                console.log(tab, event);
            },
            change(){
                this.form.resume=this.form.checked===true?'block':'none';
            },
            changeModify(){
               this.formModify.resume=this.formModify.checked===true?'block':'none';
            },
            cancel_interview_open(interview_id){
                console.log(interview_id);
                for(let i=0;i<this.tableData.length;i++){
                    if(this.tableData[i].interview_id===interview_id){
                        this.cancelObj.name=this.tableData[i].interview_candidate_name;
                        this.cancelObj.position=this.tableData[i].interview_candidate_position;
                        this.cancelObj.company=this.tableData[i].interview_company_name;
                        this.cancelObj.mail=this.tableData[i].interview_candidate_mail;
                    }
                }
                this.cancelObj.interview_id=interview_id;
                this.dialogVisible_cancel_interview=true;
            },
            async cancel_interview(){
                let result=await axios.get('/cancelInterview?interview_id='+this.cancelObj.interview_id+'&company='+this.cancelObj.company+'&position='+this.cancelObj.position+'&isSendMail='+this.cancelObj.isSendMail+'&mail='+this.cancelObj.mail+'&name='+this.cancelObj.name);
                if(result.data===1){
                    this.$message({
                        type: 'success',
                        message: '取消视频面试成功!'
                    });
                }else{
                    this.$message({
                        type: 'error',
                        message: '取消视频面试失败'
                    });
                }
                this.dialogVisible_cancel_interview=true;
                this.getMyCreateInterviewList();
            },
            modify_interview_open(row){
                console.log(row);
                this.formModify.interview_id=row.interview_id;
                this.formModify.company=row.interview_company_name;
                this.formModify.position=row.interview_candidate_position;
                this.formModify.candidate.mail=row.interview_candidate_mail;
                this.formModify.candidate.name=row.interview_candidate_name;
                this.formModify.candidate.phone=row.interview_candidate_phone;
                this.formModify.judge.mail=row.interview_judge_mail;
                this.formModify.judge.name=row.interview_judge_name;
                this.formModify.judge.phone=row.interview_judge_phone;
                this.formModify.recording=row.interview_recording===1?true:false;
                this.dialogVisible_interview_modify=true;
            },
            async modify_interview(){
                this.dialogVisible_interview_modify=false;
                let params=new FormData();
                let date1=this.formModify.date.date1;
                let date2=this.formModify.date.date2;
                let date=date1.getFullYear()+"-"+(parseInt(date1.getMonth())+1)+"-"+date1.getDate()+" "+date2.getHours()+":"+date2.getMinutes();
                params.append("interview_id",this.formModify.interview_id);
                params.append("time",date);
                params.append("company",this.formModify.company);
                params.append("position",this.formModify.position);
                params.append("recording",this.formModify.recording===true?1:0);
                params.append("resume",this.formModify.checked===true?1:0);
                params.append("file",document.getElementById("fileModify").files[0]);
                let result=await axios({
                    method: 'post',
                    url: '/updateInterview',
                    data: params,
                    headers:{
                        "Content-Type": "multipart/form-data"
                    }
                });
                if(result.data===1){
                    this.$message({
                        type: 'success',
                        message: '修改视频面试成功!'
                    });
                }else{
                    this.$message({
                        type: 'info',
                        message: '修改视频面试失败'
                    });
                }
                this.getMyCreateInterviewList();
            },
            async delete_interview_open(interview_id){
                this.$confirm('此操作将永久删除该面试记录, 是否继续?', '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning'
                }).then(() => {
                    this.deleteInterview(interview_id);
                }).catch(() => {
                    this.$message({
                        type: 'info',
                        message: '已取消删除'
                    });
                });
            },
            end_interview_open(interview_id){
                this.$confirm('结束面试后无法继续进行面试，是否确定结束面试?', '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning'
                }).then(() => {
                    this.endInterviewState(interview_id,"33");
                }).catch(() => {
                    this.$message({
                        type: 'info',
                        message: '已取消结束面试'
                    });
                });
                this.getMyCreateInterviewList();
            },
            async create_Interview(){
                this.dialogVisible_my_create=false;
                let params=new FormData();
                let date1=this.form.date.date1;
                let date2=this.form.date.date2;
                let date=date1.getFullYear()+"-"+(parseInt(date1.getMonth())+1)+"-"+date1.getDate()+" "+date2.getHours()+":"+date2.getMinutes();
                params.append("interview_begin_time",date);
                params.append("interview_company_name",this.form.company);
                params.append("interview_candidate_position",this.form.position);
                params.append("interview_candidate_phone",this.form.candidate.phone);
                params.append("interview_candidate_name",this.form.candidate.name);
                params.append("interview_candidate_mail",this.form.candidate.mail);
                params.append("interview_judge_phone",this.form.judge.phone);
                params.append("interview_judge_name",this.form.judge.name);
                params.append("interview_judge_mail",this.form.judge.mail);
                params.append("interview_recording",this.form.recording===true?1:0);
                params.append("interview_candidate_resume",this.form.checked===true?1:0);
                params.append("resume",document.getElementById("file").files[0]);
                let result=await axios({
                    method: 'post',
                    url: '/createInterview',
                    data: params,
                    headers:{
                        "Content-Type": "multipart/form-data"
                    }
                });
                if(result.data===1){
                    this.$message({
                        type: 'success',
                        message: '创建视频面试成功!'
                    });
                }else{
                    this.$message({
                        type: 'info',
                        message: '创建视频面试失败'
                    });
                }
                this.getMyCreateInterviewList();
            },
            async getUserInfo(){
                let result= await axios.get('/getUserInfo');
                this.userInfo.user_phone=result.data.user_id;
                console.log(result.data.user_company);
                this.userInfo.user_company=result.data.user_company;
                this.websocket=new WebSocket("ws://localhost:8080/test/one/ming");
                this.websocket.onmessage=this.getMessage;
            },
            async signOut(){
                await axios.get('/signOut');
                window.location.href="/test_login";
            },
            async getMyCreateInterviewList(){
                let result=await axios.get('/getMyCreateInterviewList');
                this.tableData=result.data;
                console.log(result.data);
                this.pageSize=this.tableData.length/5;
                this.pageSize*=10;
            },
            uploadBefore(){
                let file=document.getElementById("file").files[0];
                let fileType=file.name.substring(file.name.lastIndexOf(".")+1,file.name.length);
                if(fileType!='pdf'&&fileType!='docx'){
                    this.$message({
                        type: 'error',
                        message: '请上传pdf,docx格式文件'
                    });
                    document.getElementById("file").value='';
                }
                else if(file.length>1024*1024*2){
                    this.$message({
                        type: 'error',
                        message: '文件太大,请处理后提交，最大2MB'
                    });
                    document.getElementById("file").value='';
                }
            },
            async deleteInterview(interview_id){
                let result= await axios.get('/delete_interview?interview_id='+interview_id);
                if(result.data===1){
                    this.$message({
                        type: 'success',
                        message: '删除成功!'
                    });
                }else{
                    this.$message({
                        type: 'error',
                        message: '删除失败'
                    });
                }
                this.getMyCreateInterviewList();
            },
            async endInterviewState(interview_id,interview_state){
                let result=await axios.get('/end_Interview_State?interview_id='+interview_id+'&interview_state='+interview_state);
                if(result.data===1){
                    this.$message({
                        type: 'success',
                        message: '修改面试状态成功'
                    });
                }else{
                    this.$message({
                        type: 'error',
                        message: '修改面试状态失败'
                    });
                }
                this.getMyCreateInterviewList();
            },
            copyLinkContent(content){
                console.log(content);
                this.$copyText(content).then(function (e) {
                    console.log(e)
                }, function (e) {
                    console.log(e)
                });
                this.$message({
                    type: 'success',
                    message: '复制内容成功'
                });
            },
            async getMyCreateInterviewRemarksList(){
                let result=await axios.get('/getMyCreateInterviewRemarksList');
                this.remarksList=result.data;
                console.log(this.remarksList);
            },
            getOneInterviewRemarks(interview_id){
                this.remarks={};
                this.dialogVisible_remarks_interview=true;
                for(let i=0;i<this.remarksList.length;i++){
                    if(this.remarksList[i].remarks_interview_id===interview_id){
                        this.remarks.radio=this.remarksList[i].remarks_state;
                        this.remarks.textarea=this.remarksList[i].remarks_content;
                    }
                }
                this.remarks.interview_id=interview_id;
            },
            async setInterviewRemarks(){
                let result=await axios.get('/setInterviewRemarks?interview_id='+this.remarks.interview_id+'&state='+this.remarks.radio+'&content='+this.remarks.textarea);
                if(result.data===1){
                    this.$message({
                        type: 'success',
                        message: '备注候选人面试信息成功'
                    });
                }else{
                    this.$message({
                        type: 'error',
                        message: '备注候选人面试信息失败'
                    });
                }
                this.dialogVisible_remarks_interview=false;
                this.getMyCreateInterviewRemarksList();
            },
            async getMyCreateInterviewRecording(){
                let result=await axios.get('/getMyCreateInterviewRecording');
                this.recordingList=result.data;
                console.log(this.recordingList);
            },
            centerInterview(code,interview_state){
               if(interview_state==='22'||interview_state==='33'){
                   window.location.href="/test_interview_end/"+code;
               }
               else{
                   axios.get('/setInterviewStateByCode?code='+code);
                   window.location.href="/test_interview/"+code;
               }
            },
            getMessage(msg){
                console.log("有用户连接");
                this.getMyCreateInterviewList();
            },
            exam(){
                window.location.href="/test_exam";
            }
        }
    })
</script>
</body>
</html>